# Copyright (c) 2007, Adobe Systems, Incorporated
# All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 
# * Redistributions of source code must retain the above copyright
#   notice, this list of conditions and the following disclaimer.
# 
# * Redistributions in binary form must reproduce the above copyright
#   notice, this list of conditions and the following disclaimer in the
#   documentation and/or other materials provided with the distribution.
# 
# * Neither the name of Adobe Systems, Network Resonance nor the names of its
#   contributors may be used to endorse or promote products derived from
#   this software without specific prior written permission.
# 
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# ICE_STUN_ARCHIVE:
#    source files to compile to object and to place in a library archive
#
# ICE_STUN_ARCHIVE_NAME:
#    the library name to use to archive the object files
#
# ICE_STUN_ARCHIVE_TYPE:
#    either 'static', 'dynamic', or 'jni' (the default is 'static')
#
# ICE_STUN_AUTOGENERATED:
#    whether this targets.mk is autogenerated (either 'true' or 'false')
#
# ICE_STUN_COMPILE:
#    source files to compile to object
#
# ICE_STUN_COPY:
#    files to copy to the build directory
#
# ICE_STUN_GLOBAL_CFLAGS:
#    preprocessor and compile-time flags specific to compiling
#    everything
#
# ICE_STUN_GLOBAL_LDFLAGS:
#    link-time flags specific to linking everything
#
# ICE_STUN_LINK:
#    source files compile and link
#
# ICE_STUN_LOCAL_CFLAGS:
#    preprocessor and compile-time flags specific to compiling only
#    the files in this module directory
#
# ICE_STUN_LOCAL_LDFLAGS:
#    link-time flags specific to linking only the files in
#    this module directory
#
# ICE_STUN_PREFIX:
#    defines the module name, which also serves as the
#    prefix for all the variable names defined in this file
#
# ICE_STUN_SUBDIRS:
#    subdirectories containing additional targets.mk files
#
ICE_STUN_ARCHIVE                  = addrs.c nr_socket_turn.c stun_build.c \
                                    stun_client_ctx.c stun_codec.c stun_hint.c \
                                    stun_msg.c stun_proc.c stun_server_ctx.c \
                                    stun_util.c turn_client_ctx.c
ICE_STUN_ARCHIVE_NAME             =
ICE_STUN_ARCHIVE_TYPE             =
ICE_STUN_AUTOGENERATED            = true
ICE_STUN_COMPILE                  =
ICE_STUN_COPY                     =
ICE_STUN_GLOBAL_CFLAGS            = -DUSE_ICE \
                                    -DUSE_RFC_3489_BACKWARDS_COMPATIBLE \
                                    -DUSE_STUND_0_96 -DUSE_STUN_PEDANTIC \
                                    -DUSE_TURN
ICE_STUN_GLOBAL_LDFLAGS           =
ICE_STUN_LINK                     =
ICE_STUN_LOCAL_CFLAGS             =
ICE_STUN_LOCAL_LDFLAGS            =
ICE_STUN_PREFIX                   = ICE_STUN
ICE_STUN_SUBDIRS                  =



#
#    AUTOMATICALLY-GENERATED SECTION
#



#
#    LOCAL ENVIRONMENT
#
ICE_STUN_BUILD                    = addrs.$(OBJSUFFIX) addrs.d \
                                    nr_socket_turn.$(OBJSUFFIX) \
                                    nr_socket_turn.d stun_build.$(OBJSUFFIX) \
                                    stun_build.d stun_client_ctx.$(OBJSUFFIX) \
                                    stun_client_ctx.d stun_codec.$(OBJSUFFIX) \
                                    stun_codec.d stun_hint.$(OBJSUFFIX) \
                                    stun_hint.d stun_msg.$(OBJSUFFIX) \
                                    stun_msg.d stun_proc.$(OBJSUFFIX) \
                                    stun_proc.d stun_server_ctx.$(OBJSUFFIX) \
                                    stun_server_ctx.d stun_util.$(OBJSUFFIX) \
                                    stun_util.d turn_client_ctx.$(OBJSUFFIX) \
                                    turn_client_ctx.d



#
#    GLOBAL ENVIRONMENT
#
GLOBAL_BUILD                     += $(ICE_STUN_BUILD)
GLOBAL_CFLAGS                    += $(ICE_STUN_GLOBAL_CFLAGS) \
                                 -I$(ICE_STUN_SRCDIR)
GLOBAL_LDFLAGS                   += $(ICE_STUN_GLOBAL_LDFLAGS)



#
#    GENERIC DEPENDENCIES
#
all:                                $(ICE_STUN_BUILD)
depend:                             addrs.d
depend:                             nr_socket_turn.d
depend:                             stun_build.d
depend:                             stun_client_ctx.d
depend:                             stun_codec.d
depend:                             stun_hint.d
depend:                             stun_msg.d
depend:                             stun_proc.d
depend:                             stun_server_ctx.d
depend:                             stun_util.d
depend:                             turn_client_ctx.d



#
#    BUILD DEPENDENCIES
#

addrs.$(OBJSUFFIX): $(ICE_STUN_SRCDIR)addrs.c addrs.d
	$(COMPILE.c) $@ $< $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

addrs.d: $(ICE_STUN_SRCDIR)addrs.c
	$(COMPILE.c) $@ $< -MM -MG $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

nr_socket_turn.$(OBJSUFFIX): $(ICE_STUN_SRCDIR)nr_socket_turn.c nr_socket_turn.d
	$(COMPILE.c) $@ $< $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

nr_socket_turn.d: $(ICE_STUN_SRCDIR)nr_socket_turn.c
	$(COMPILE.c) $@ $< -MM -MG $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

stun_build.$(OBJSUFFIX): $(ICE_STUN_SRCDIR)stun_build.c stun_build.d
	$(COMPILE.c) $@ $< $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

stun_build.d: $(ICE_STUN_SRCDIR)stun_build.c
	$(COMPILE.c) $@ $< -MM -MG $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

stun_client_ctx.$(OBJSUFFIX): $(ICE_STUN_SRCDIR)stun_client_ctx.c stun_client_ctx.d
	$(COMPILE.c) $@ $< $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

stun_client_ctx.d: $(ICE_STUN_SRCDIR)stun_client_ctx.c
	$(COMPILE.c) $@ $< -MM -MG $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

stun_codec.$(OBJSUFFIX): $(ICE_STUN_SRCDIR)stun_codec.c stun_codec.d
	$(COMPILE.c) $@ $< $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

stun_codec.d: $(ICE_STUN_SRCDIR)stun_codec.c
	$(COMPILE.c) $@ $< -MM -MG $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

stun_hint.$(OBJSUFFIX): $(ICE_STUN_SRCDIR)stun_hint.c stun_hint.d
	$(COMPILE.c) $@ $< $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

stun_hint.d: $(ICE_STUN_SRCDIR)stun_hint.c
	$(COMPILE.c) $@ $< -MM -MG $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

stun_msg.$(OBJSUFFIX): $(ICE_STUN_SRCDIR)stun_msg.c stun_msg.d
	$(COMPILE.c) $@ $< $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

stun_msg.d: $(ICE_STUN_SRCDIR)stun_msg.c
	$(COMPILE.c) $@ $< -MM -MG $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

stun_proc.$(OBJSUFFIX): $(ICE_STUN_SRCDIR)stun_proc.c stun_proc.d
	$(COMPILE.c) $@ $< $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

stun_proc.d: $(ICE_STUN_SRCDIR)stun_proc.c
	$(COMPILE.c) $@ $< -MM -MG $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

stun_server_ctx.$(OBJSUFFIX): $(ICE_STUN_SRCDIR)stun_server_ctx.c stun_server_ctx.d
	$(COMPILE.c) $@ $< $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

stun_server_ctx.d: $(ICE_STUN_SRCDIR)stun_server_ctx.c
	$(COMPILE.c) $@ $< -MM -MG $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

stun_util.$(OBJSUFFIX): $(ICE_STUN_SRCDIR)stun_util.c stun_util.d
	$(COMPILE.c) $@ $< $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

stun_util.d: $(ICE_STUN_SRCDIR)stun_util.c
	$(COMPILE.c) $@ $< -MM -MG $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

turn_client_ctx.$(OBJSUFFIX): $(ICE_STUN_SRCDIR)turn_client_ctx.c turn_client_ctx.d
	$(COMPILE.c) $@ $< $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

turn_client_ctx.d: $(ICE_STUN_SRCDIR)turn_client_ctx.c
	$(COMPILE.c) $@ $< -MM -MG $(ICE_STUN_LOCAL_CFLAGS) $(GLOBAL_CFLAGS)

$(GLOBAL_LIBNAME): addrs.$(OBJSUFFIX)

$(GLOBAL_LIBNAME): nr_socket_turn.$(OBJSUFFIX)

$(GLOBAL_LIBNAME): stun_build.$(OBJSUFFIX)

$(GLOBAL_LIBNAME): stun_client_ctx.$(OBJSUFFIX)

$(GLOBAL_LIBNAME): stun_codec.$(OBJSUFFIX)

$(GLOBAL_LIBNAME): stun_hint.$(OBJSUFFIX)

$(GLOBAL_LIBNAME): stun_msg.$(OBJSUFFIX)

$(GLOBAL_LIBNAME): stun_proc.$(OBJSUFFIX)

$(GLOBAL_LIBNAME): stun_server_ctx.$(OBJSUFFIX)

$(GLOBAL_LIBNAME): stun_util.$(OBJSUFFIX)

$(GLOBAL_LIBNAME): turn_client_ctx.$(OBJSUFFIX)
